string1 = 'Hello, World!'
string2 = "I'm a string."
string3 = '''This is a 
multiline 
string.'''

name = 'John'
age = 30
print('My name is %s and I am %d years old.' % (name, age))

name = 'John'
age = 30
print('My name is {} and I am {} years old.'.format(name, age))

name = 'John'
age = 30
print(f'My name is {name} and I am {age} years old.')


def verify_string_methods():
    # 创建一个字符串
    s = "Hello, World!"

    # 使用 find 方法查找子串 "World" 的位置
    index = s.find("World")
    print(f"'World' found at index: {index}")

    # 使用 index 方法查找子串 "World" 的位置
    try:
        index = s.index("World")
        print(f"'World' found at index: {index}")
    except ValueError as e:
        print(e)

    # 使用 replace 方法替换 "World" 为 "Python"
    new_s = s.replace("World", "Python")
    print(f"Replaced string: {new_s}")


verify_string_methods()
